package com.qf.j2112.service.impl;

import java.util.List;

import com.qf.j2112.po.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qf.j2112.mapper.SysUserMapper;
import com.qf.j2112.service.SysUserService;

/**
 * 用户管理Service业务层处理
 * @author j2112
 * @date 2022-04-12
 */

@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    /**
     * 查询用户
     * @param userId 用户主键
     * @return 用户
     */
    @Override
    public SysUser selectSysUserByUserId(Integer userId) {
        return sysUserMapper.selectSysUserByUserId(userId);
    }

    /**
     * 查询用户列表
     * @return 用户
     */
    @Override
    public List<SysUser> selectSysUserList() {
        return sysUserMapper.selectSysUserList();
    }

    /**
     * 新增用户管理
     * 
     * @param sysUser 用户管理
     * @return 结果
     */
    @Override
    public int insertSysUser(SysUser sysUser) {
        return sysUserMapper.insertSysUser(sysUser);
    }

    /**
     * 修改用户管理
     * 
     * @param sysUser 用户管理
     * @return 结果
     */
    @Override
    public int updateSysUser(SysUser sysUser) {
        return sysUserMapper.updateSysUser(sysUser);
    }

    /**
     * 批量删除用户
     * @param userIds 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteSysUserByUserIds(Integer[] userIds)
    {
        return sysUserMapper.deleteSysUserByUserIds(userIds);
    }

    /**
     * 删除用户信息
     * @param userId 用户主键
     * @return 结果
     */
    @Override
    public int deleteSysUserByUserId(Integer userId)
    {
        return sysUserMapper.deleteSysUserByUserId(userId);
    }

    @Override
    public SysUser findUserByUname(String uname) {
        return sysUserMapper.findUserByUname(uname);
    }
}
